package com.example.demo.event.listener;

import com.example.demo.event.base.AbstractAsyncEventListener;
import com.example.demo.event.base.EventSource;
import com.example.demo.event.source.Demo3EventSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * demo3-1事件监听
 */
@Component
public class Demo3_1EventListener extends AbstractAsyncEventListener<Demo3EventSource> {

	private final static Logger LOG = LoggerFactory.getLogger(Demo3_1EventListener.class);


	@Override
	public void exec(EventSource<Demo3EventSource> eventSource) {
		Demo3EventSource eventVO = eventSource.getSource();

		LOG.info("接收事件： source={}", eventVO.toString());

		// do something......
		LOG.info("具体业务处理......");

		LOG.info("处理事件完毕： source={}", eventVO.toString());

		System.out.println();
	}

}
